package com.zf.museum.controller;

import com.zf.museum.model.Record;
import com.zf.museum.service.RecordService;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/record")
public class RecordController {

    @Autowired
    private RecordService recordService;

    @GetMapping("/getAll")
    @RequiresRoles("admin")
    public List<Record> getAll(){

        return recordService.getAll();
    }
}
